import axios from 'axios'
axios.defaults.withCredentials = true;
import { Loading } from 'element-ui'
var loadinginstace
axios.interceptors.request.use(config => {
    loadinginstace = Loading.service({
        lock: true,
        text: 'Loading',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.3)',
        customClass: "osloading",
        fullscreen: true
    })
    return config
})

axios.interceptors.response.use(res => {
    if(res.status===200){
        loadinginstace.close()
        return res
    }
    
})

const find = () => {
    return axios.get("/api/position/find").then(res => {
        return res
    });
}
export {
    find
}